import { ReplyTypes, ScriptTypes } from '@/types'
import { floatToFixed2 } from '@/utils'

// 格式化金额【分转元】
// @ts-ignore
export const fenToYuanFormat = (_, __, cellValue: any, ___) => {
  return `￥${floatToFixed2(cellValue)}`
}

// 格式化话术类型
export const formatScriptType = (type: ScriptTypes) => {
  switch (type) {
    case ScriptTypes.NormalQuestion:
      return '正常问题话术'
    case ScriptTypes.NegativeReply:
      return '客户否定后回答'
    case ScriptTypes.UnClearReply:
      return '未听清客户回答'
    default:
      return ''
  }
}

// 格式化回答方式
export const formatIsReply = (isReply: ReplyTypes) => {
  switch (isReply) {
    case ReplyTypes.YesOrNo:
      return '回答是否'
    case ReplyTypes.None:
      return '不需要回答'
    case ReplyTypes.Certificate:
      return '证件托举'
    case ReplyTypes.Open:
      return '开放式回答'
    case ReplyTypes.Confirm:
      return '客户朗读确认'
    default:
      return ''
  }
}
